home *** CD-ROM | disk | FTP | other *** search
- on mouseUp
-
- --initialize xobject
- if objectP(myPrinter) then myPrinter(mDispose)
- put print_x(mNew) into myPrinter
-
- --styles
- myPrinter(mSetHeaderStyle1, "Times", 14, 1) -- font style for header 1
- myPrinter(mSetHeaderStyle2, "Times", 10, 0) -- font style for header 2
- myPrinter(mSetBodyStyle, "Times", 10, 0) -- font style for main body text
-
- myPrinter(mSetJustify1, 1) -- left justify header 1
- myPrinter(mSetJustify2, 1) -- left justify header 2
- myPrinter(mSetBodyJustify, 1) -- left justify the body text
- myPrinter(mSetBodyTop, 70) -- set the upper start point for body
-
-
- --create local variable with body text & Copyright info
- put "This is copyright info" into theCopyright
-
- put the text of field "artText" & return & return & theCopyright into thetext
-
- put 30 into maxDocumentLength
- put 1 into pageNumber
-
- repeat while the number of lines of thetext >= maxDocumentLength
-
- put line 1 to maxDocumentLength of thetext into textToPrint
-
- -- put "Printing page #"&pagenumber -- DEBUG
-
- put myPrinter(mPrintPage, the text of cast "artHead", the text of cast "artHead2", ¬
- textToPrint, "", 0) into printerResult
-
- if printerResult <> "OK" then
- alert "There was a printer error. Code:"&&printerResult
- end if
-
- delete line 1 to maxDocumentLength of theText
- put pageNumber + 1 into pageNumber
- end repeat
-
- -- print the final page
- put thetext into textToPrint
-
- -- put "Printing page #"&pagenumber -- DEBUG
- put myPrinter(mPrintPage, the text of cast "artHead", the text of cast "artHead2", ¬
- textToPrint, "", 0) into printerResult
-
- if printerResult <> "OK" then
- alert "There was a printer error. Code:"&&printerResult
- end if
-
- -- printing is done
- myPrinter(mDispose)
-
- end
-